package test6.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class SearchPage {
	private static WebElement element=null;
	
	public static WebElement search_01(WebDriver driver){  //跳转到搜索页面
		element = driver.findElement(By.xpath("//img[@alt='Search Flights Button']"));
		return element;
	}
	
	public static WebElement search_DepartureCity(WebDriver driver){  //搜索出发城市
		element = driver.findElement(By.name("depart"));
		return element;
	}
	
	public static WebElement search_ArrivalCity(WebDriver driver){  //搜索目标城市
		element = driver.findElement(By.name("arrive"));
		return element;
	}
	
	public static WebElement search_departDate(WebDriver driver){  //搜索出发城市的日期
		element = driver.findElement(By.name("departDate"));
		return element;
	}
	
	public static WebElement search_returnDate(WebDriver driver){  //搜索目的城市的日期
		element = driver.findElement(By.name("returnDate"));
		return element;
	}
	
	public static WebElement search_nb(WebDriver driver){  //搜索乘坐人数
		element = driver.findElement(By.name("numPassengers"));
		return element;
	}
	
	public static WebElement search_Roundtripticket(WebDriver driver){  //勾选往返机票
		element = driver.findElement(By.name("roundtrip"));
		return element;
	}
	
	public static WebElement search_Aisle(WebDriver driver){  //选座位
		element = driver.findElement(By.name("seatPref"));
		return element;
	}
	
	public static WebElement search_Window(WebDriver driver){  //选座位
		element = driver.findElement(By.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Window'])[1]/input[1]"));
		return element;
	}
	
	public static WebElement search_None(WebDriver driver){  //选座位
		element = driver.findElement(By.xpath("(.//*[normalize-space(text()) and normalize-space(.)='None'])[1]/input[1]"));
		return element;
	}
	
	public static WebElement search_First(WebDriver driver){  //选类型的座位
		element = driver.findElement(By.name("seatType"));
		return element;
	}
	
	public static WebElement search_Business(WebDriver driver){  //选类型的座位
		element = driver.findElement(By.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Business'])[1]/input[1]"));
		return element;
	}
	
	public static WebElement search_Coach(WebDriver driver){  //选类型的座位
		element = driver.findElement(By.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Coach'])[1]/input[1]"));
		return element;
	}
	
	public static WebElement search_submit(WebDriver driver){  //确认
		element = driver.findElement(By.name("findFlights"));
		return element;
	}
	
	public static WebElement search_list1(WebDriver driver){  //航班第一个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[1]/tbody/tr[2]/td[1]/input"));
		return element;
	}
	
	public static WebElement search_list2(WebDriver driver){  //航班第二个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[1]/tbody/tr[3]/td[1]/input"));
		return element;
	}
	
	public static WebElement search_list3(WebDriver driver){  //航班第三个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[1]/tbody/tr[4]/td[1]/input"));
		return element;
	}
	
	public static WebElement search_list4(WebDriver driver){  //航班第三个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[1]/tbody/tr[5]/td[1]/input"));
		return element;
	}
	
	public static WebElement search_rlist1(WebDriver driver){  //返回航班第一个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[2]/tbody/tr[2]/td[1]/input"));
		return element;
	}
	public static WebElement search_rlist2(WebDriver driver){  //返回航班第二个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[2]/tbody/tr[3]/td[1]/input"));
		return element;
	}
	public static WebElement search_rlist3(WebDriver driver){  //返回航班第三个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[2]/tbody/tr[4]/td[1]/input"));
		return element;
	}
	public static WebElement search_rlist4(WebDriver driver){  //返回航班第四个
		element = driver.findElement(By.xpath("/html/body/blockquote/form/center/table[2]/tbody/tr[5]/td[1]/input"));
		return element;
	}

	public static WebElement search_reserveFlights(WebDriver driver){  //再次确认
		element = driver.findElement(By.name("reserveFlights"));
		return element;
	}
	
	public static WebElement search_buyFlights(WebDriver driver){  //支付
		element = driver.findElement(By.name("buyFlights"));
		return element;
	}

}
